# -*- coding: utf-8 -*-
from tornado import web, ioloop
from tornado.web import RedirectHandler

class IndexHandler(web.RequestHandler):
    def get(self):
        print("Hello Tornado!")
        self.finish("Hello Tornado!")

class LoginHandler(web.RequestHandler):
    def get(self):
        print(self.reverse_url('index'))
        self.redirect('/')

if __name__ == "__main__":
    app = web.Application([
        web.URLSpec('/', IndexHandler, name='index'),
        web.URLSpec('/login/', LoginHandler),
        web.URLSpec('/index/', RedirectHandler, {'url': '/'})
    ], debug=True)
    app.listen(8080)
    ioloop.IOLoop.current().start()

